// 引入vue-router
import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter)
import Home from '@/views/Home'
import Topic from '@/views/Topic'
import Category from '@/views/Category'
import Cart from '@/views/Cart'
import User from '@/views/User'
const router = new VueRouter({
    mode: "history",
    routes: [
        { 'path': '/', redirect: '/home' },//重定向首页
        { 'path': '/home', component: Home, name: 'home' },
        { 'path': '/topic', component: Topic, name: 'topic' },
        { 'path': '/category', component: Category, name: 'category' },
        { 'path': '/cart', component: Cart, name: 'cart' },
        { 'path': '/user', component: User, name: 'user' },
    ]
})

export default router

